<template>
	<view class="container">
		<view class="set-info" @click="goInfor">
			<view class="set-left">
				
				<view class="pic"><image :src="avatar==''?'../../static/images/upload-img.png':avatar" mode="aspectFit"></image></view>
				<view class="text">
					<view class="name">昵称 {{name}}</view>
					<view class="phone">手机号码：{{telephone}}</view>
				</view>
			</view>
			<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
		</view>

		<view class="set-box">
			<view class="set-item"  @click="changePossword">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_pwd.png" mode="aspectFit"></image></view>
					<view class="text">修改密码</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>
			<view class="set-item"  @click="call">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_kf.png" mode="aspectFit"></image></view>
					<view class="text">呼叫客服</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>

			<view class="set-item" @click="gofeed">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_feedback.png" mode="aspectFit"></image></view>
					<view class="text">意见反馈</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>

<!-- 			<view class="set-item">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_time.png" mode="aspectFit"></image></view>
					<view class="text">店铺剩余时间</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view> -->

			<view class="set-item" @click="goHelp">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_help.png" mode="aspectFit"></image></view>
					<view class="text">使用帮助</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>
			<view class="set-item"  @click="goabout">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_about.png" mode="aspectFit"></image></view>
					<view class="text">关于</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>
			<view class="set-item">
				<view class="left">
					<view class="pic"><image src="../../static/images/icon_update.png" mode="aspectFit"></image></view>
					<view class="text">检测更新</view>
				</view>
				<view class="arrow"><image src="../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>
		</view>

		<view class="dropBtn"><view class="btn" @click="gologin">退出当前账号</view></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			telephone:'',
			name:'',
			avatar:'',
			arry:''
		};
	},
	onLoad() {
		this.show()
	},
onBackPress(){
	uni.switchTab({
		url:'../shop/index'
	})
	return true
},
	methods: {
		show() {
			this.$ajax('api/v1.shop/index', {}, 'GET').then(res => {
				console.log(res);
				const{telephone,name,avatar}=res.result.user_info;
				this.arry=res.result.user_info;
				this.name=name;
				this.telephone=telephone;
				this.avatar=avatar;
			});
		},
		gologin(){
			try {
			    uni.clearStorageSync();
			} catch (e) {
			    // error
			}
			uni.navigateTo({
				url:'../kitty-BasicLogin/login'
			})
		},
		call(){
			uni.makePhoneCall({
			    phoneNumber: '110' //仅为示例
			});
		},
	goInfor(){
		uni.navigateTo({
			 //
			url:'../shop/setting/personalinfo?id=' +JSON.stringify(this.arry)
		})
	},
	changePossword(){
		
		uni.navigateTo({
	url:'../shop/setting/changePassword?id='+JSON.stringify(this.arry)
		})
		
	},
	gofeed(){
		uni.navigateTo({
		url:'../specification/feedback'
			})
	},
	goHelp(){
		uni.navigateTo({
			url:'../shop/setting/usinghelp'
		})
	},
	goabout(){
		uni.navigateTo({
			url:'../shop/setting/about'
		})
	}
	},

};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}

.set-info {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	background-color: #fff;
	padding: 40upx 30upx;
	margin-bottom: 20upx;

	.set-left {
		display: flex;
		flex-direction: row;

		.pic {
			image {
				width: 90upx;
				height: 90upx;
				border-radius: 50%;
				margin-right: 30upx;
			}
		}

		.text {
			font-size: 30upx;
			color: #333;

			.name {
				margin-bottom: 15upx;
			}
		}
	}

	.arrow {
		image {
			width: 20upx;
			height: 35upx;
		}
	}
}

.set-box {
	.set-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		background-color: #fff;
		padding: 35upx 30upx;
		border-bottom: 1upx #eeeeee solid;
		&:nth-child(4) {
			margin-bottom: 20upx;
		}
		&:nth-child(5) {
			margin-bottom: 20upx;
		}
		&:nth-child(6) {
			margin-bottom: 20upx;
		}
		.left {
			display: flex;
			flex-direction: row;
			align-items: center;
			.pic {
				width: 44upx;
				margin-right: 20upx;
				margin-top: 10upx;
				image {
					width: 100%;
					height: 44upx;
				}
			}

			.text {
				font-size: 30upx;
				color: #333;
				line-height: 50upx;
			}
		}

		.arrow {
			image {
				width: 20upx;
				height: 35upx;
			}
		}
	}
}

.dropBtn {
	background-color: #fff;
	padding: 40upx 0;
	text-align: center;
	margin: 60upx 0 180upx 0;
	.btn {
		color: #f64444;
		text-align: center;
	}
}
</style>
